Bind PCB port devices

Description

Before following our Python Basic Control Tutorial and ROS Basic Tutorial, we need to bind our ROS Control Board device ID to a specified port number (aka device remapping). If it is not bound to the specified port number, it is very likely that an error will be reported when running the startup file. For example:

AttributeError:‘Rosmaster’ object has no attribute 'ser'

AttributeError:‘yahboomcar_driver’ object has no attribute 'velPublisher'

······(Most ROS function packages need to be bound to a specified port number, and the operation steps are basically the same)

Virtual machine

Use VMware Workstation to demonstrate device ID binding, and other motherboards (Raspberry Pi, Jetson series, etc.) can follow this step for device ID binding.

1、Open the virtual machine image

image-20230706160618907

2、Connect device

Insert the device into the computer through the USB interface, there are two methods to connect the device.

Method-1

Choose to connect to the virtual machine

2

In "Virtual Machine Settings" → "Removable Devices", select the corresponding device connection

image-20230706161340009

NOTE: The steps are the same for multiple devices connected to the virtual machine!

ROS expansion board

View the devices connected to the system

4

You can see the USB device information corresponding to the ROS control board through the lsusb command. (The device ID information we mainly focus on is 1a86:7523)

Method-1

Edit myserial.rules file

The ROS control board device ID information 1a86:7523 is required here, and the following is the content of the myserial.rules file

Note: Binding failures often occur at this step. It is recommended to directly open the tutorial copy we provided.

image-20230708174725153

Save the file and exit, then enter the following command to give execution permission to myserial.rules

Enter the following three commands to re-plug the ROS control board device.

Enter the following command to check whether the device number is successfully bound.

When the picture shown in the figure below appears, it can be considered that the binding is successful.

image-20230708175254917

 

First download the edited rule file, and then open the terminal in the directory where the myserial.rules file is located

image-20230708180438099

Enter the following command to copy the edited rule file to the /etc/udev/rules.d directory

Then enter the following command to give myserial.rules execution permission

Enter the following three commands to re-plug the ROS control board device

Enter the following command to check whether the device number is successfully bound

When the picture shown in the figure below appears, it can be considered that the binding is successful.

image-20230708181045285